<?php

$a = "test ${$foo->bar[0]}";